package com.tjsiqi.controller;

import com.tjsiqi.beans.PageQuery;
import com.tjsiqi.common.JsonData;
import com.tjsiqi.param.SearchwxUnitsParam;
import com.tjsiqi.service.WxOrderUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/sys/wxOrderUnit")
public class WxOrderUnitController {


    @Resource
    private WxOrderUnitService wxOrderUnitService;

    //管理员查询施工单位页面
    @RequestMapping("/wxOrderUnit.page")
    public ModelAndView wxOrderUnitPage() {
        return new ModelAndView("wxOrderUnit");
    }

    //管理员查询施工单位列表
    @RequestMapping("/wxOrderUnits")
    @ResponseBody
    public JsonData getWxOrderUnits(HttpServletRequest request, HttpServletResponse response, SearchwxUnitsParam param, PageQuery page) {
        return JsonData.success(wxOrderUnitService.getWxOrderUnits(param, page));
    }
}
